using SharedKernel.Infrastructure.Repositories;
using System;
using System.Threading.Tasks; 
using UserService.Domain.Models;
using UserService.Domain.ValueObjects;

namespace UserService.Domain.Repositories
{
    /// <summary>
    /// 用户仓储接口
    /// </summary>
    public interface IUserRepository : IRepository<User, long>
    {
        /// <summary>
        /// 根据id获取用户
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns>用户实体</returns>
        Task<User> GetUserById(long userId);

        /// <summary>
        /// 根据用户名获取用户
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>用户实体</returns>
        Task<User> GetByUsernameAsync(string username);

        /// <summary>
        /// 根据电子邮件获取用户
        /// </summary>
        /// <param name="email">电子邮件</param>
        /// <returns>用户实体</returns>
        Task<User> GetByEmailAsync(string email);

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="dto">dto</param>
        /// <returns>用户实体</returns>
        Task<User> GetUserLogin(UserLoginValueObject dto);
    }
}